<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <channel>
        <title>Dynamisys</title> 
        <link>https://www.dynamisys.co.uk</link> 
        <description>RSS feeds for Dynamisys</description> 
        <ttl>60</ttl> <item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/115/DNN--Why-is-lucene-throwing-LockObtainFailedException#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=115</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=115&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>DNN - Why is lucene throwing LockObtainFailedException?</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/115/DNN--Why-is-lucene-throwing-LockObtainFailedException</link> 
    <description>I found that my site did not allow lucene write permissions.

I also deleted everything in App_Data\Search - allows lucene to recreate it, and cycled the&amp;nbsp;App Pool.

The Exceptions went away.
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Fri, 28 Feb 2020 10:43:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:115</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/88/Why-Cant-I-Connect-to-my-SQL-Server-Database--1--Using-SQL-Server-Security#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=88</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=88&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Why Can&#39;t I Connect to my SQL Server Database - 1 - Using SQL Server Security</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/88/Why-Cant-I-Connect-to-my-SQL-Server-Database--1--Using-SQL-Server-Security</link> 
    <description>Sadly I cannot just give you the answer to this one.&amp;nbsp; You&amp;#39;ll have to do some diagnosis yourself.&amp;nbsp; This is a basic guide to find out where the blockage lies.


 What is SQL Server Security?


This is when you have a user id and password visible in the connection string.&amp;nbsp; So the connection string would look like...


Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;


Notes: The server name may be specified as a single dot (&amp;#39;.&amp;#39;) to mean &amp;#39;same machine as I am connecting from&amp;#39;.&amp;nbsp; Instance name is only used if you have installed SQL server as a named instance.&amp;nbsp; Some do, some don&amp;#39;t.&amp;nbsp; The default is no named instance for &amp;#39;full&amp;#39; SQL Server, and sqlexpress for SQL Server express.

2. Can you connect from the server?

Install SQL Server Management Express (SSME) on the machine that hosts the database.&amp;nbsp; Can you connect from SSME using the id and password which you believe to be valid for the database.&amp;nbsp; If you can&amp;#39;t then you need to find out why and fix it.

3. Can you connect from the client?

Install SQL Server Management Express on the machine (the client) that you want to connect from.&amp;nbsp; Can you connect to the remote server and database?&amp;nbsp; Use the id and the password that Step 2 proved would work.&amp;nbsp; If you can&amp;#39;t then you know that there is a problem in the connectivity.&amp;nbsp; Things to try:


 can you ping the server from the client (this may not be conclusive as the server may have ping responses turned off)
 research the connection path between the client and the the server.&amp;nbsp; Do any firewalls or other network devices allow SQL server traffic to pass?&amp;nbsp; This is usually TCP port 1433 for normal queries and responses.&amp;nbsp; Whomever manages that SQL Server may have adjusted the port it listens on, but that is quite rare.&amp;nbsp; SQL Server also has other ports it&amp;nbsp;uses for other purposes.
 does the server have a firewall?&amp;nbsp; Does it allow SQL server traffic in?
 does the server SQL instance allow remote connections?
 does it allow remote connections on the protocol stack you plan to use?&amp;nbsp; Usually TCP/IP.
 do you have the TCP/IP (or whatever you plan to use) support installed?


3. If you can pass all the checks above then I&amp;#39;m out of ideas for the moment.&amp;nbsp; Feel free to add a comment if you have any additional things to try.

&amp;nbsp;

&amp;nbsp;
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Thu, 02 Jun 2016 13:46:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:88</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/87/Three-Killer-Reasons-why-you-should-NOT-be-building-DNN-in-Visual-Studio-or-any-other-tool#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=87</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=87&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Three Killer Reasons why you should NOT be building DNN in Visual Studio (or any other tool)</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/87/Three-Killer-Reasons-why-you-should-NOT-be-building-DNN-in-Visual-Studio-or-any-other-tool</link> 
    <description>It&amp;#39;s not necessary to build DNN from source code.&amp;nbsp; Avoid a lot of pain, ignore the &amp;#39;source&amp;#39; packages, install the &amp;#39;install&amp;#39; package.&amp;nbsp; Here&amp;#39;s why:

1 if you just want a web site then DNN is already a great solution.&amp;nbsp; Go to the site in your browser.&amp;nbsp; Login with an admin account.&amp;nbsp; From here you can create new pages; you control if and how they appear in the menu system; you can add content; upload pictures; knock yourself out.

2 if you need something more sophisticated you can download and install &amp;#39;extensions&amp;#39; (Host -&amp;gt; Extensions in the menu) to integrate more functionality into DNN.&amp;nbsp; There are hundreds of extensions - both free and paid for.

3 if you are a .Net programmer you can create your own custom extensions.&amp;nbsp; There are tutorials on the net on how to do this.

Finally if none of those are enough for you - you may want/need to modify the core code of DNN.&amp;nbsp; This is the principal reason to use the source packages and your own build.&amp;nbsp; It&amp;#39;s wisest to plug into the overall development efforts for DNN and get your change accepted into the DNN core.&amp;nbsp; (More information http://www.dnnsoftware.com/community-blog/cid/155105/dnncon-session--contributing-to-open-source-on-github).&amp;nbsp; If you don&amp;#39;t get into the DNN mainstream then you will have created a private fork of the project which is likely to become a pain point for you.&amp;nbsp; Every time you install a new release of DNN (you WANT to install them for the bug and security fixes) you will have to merge your private changes back into the new version.

If your change is half way reasonable it&amp;#39;s likely to be acceptable.&amp;nbsp; If it&amp;#39;s not acceptable you will get great advice on how to do what you want *without* the pain of creating a private fork.&amp;nbsp; Talk before you start coding!
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Tue, 10 May 2016 08:53:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:87</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/85/DNN-databaseOwner-and-objectQualifier#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=85</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=85&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>DNN databaseOwner and objectQualifier</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/85/DNN-databaseOwner-and-objectQualifier</link> 
    <description>SQL Scripts for DNN normally contain a pair of special extra tokens not seen in &amp;#39;normal&amp;#39; SQL.&amp;nbsp; For example a CREATE TABLE statement would say:

CREATE TABLE {databaseOwner}[{objectQualifier}TABLENAME]...

When processed by the SQL processor inside DNN the tokens are replaced with values read from the Web,Config file.&amp;nbsp; Typical web config values set both to an empty string making the real statement

CREATE TABLE [TABLENAME]...

If you choose to run DNN SQL in external tools such as Query Manager or SQL Server Management Studio then you must manually edit out the tokens.

Why it&amp;#39;s done this way

In the early days of DNN, web site hosting with SQL server was expensive and often priced per database.&amp;nbsp; Manipulating the {databaseOwner} and {objectQualifier} values allowed mutiple DNN installations in the same database using different objectQualifier values.&amp;nbsp; One install could have a family of tables prefixed (say) install01 and another could have a family of tables prefixed (say) install02.
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Wed, 27 Apr 2016 07:26:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:85</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/78/Setting-up-DNN-on-Amazon-EC2Server-2012SQL-Express-2012#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=78</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=78&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Setting up DNN on Amazon EC2/Server 2012/SQL Express 2012</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/78/Setting-up-DNN-on-Amazon-EC2Server-2012SQL-Express-2012</link> 
    <description>These steps worked for me.&amp;nbsp; I concentrate on stuff that&amp;#39;s relevant to EC2 or it being a new machine with an operating system I have never seen before.&amp;nbsp; Google was a big help.

I chose a t2.medium instance.&amp;nbsp; IMO smaller instances don&amp;#39;t have enough memory and burst on demand concept works perfectly for a web site.

&amp;nbsp;

&amp;nbsp;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create an instance (outside the scope of this guide)

&amp;nbsp;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I chose Windows Server 2012/64bit plus SqlExpress2012

&amp;nbsp;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This gives you a pretty virgin install of the Operating System

&amp;nbsp;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start Server Manager

&amp;nbsp;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Configure this server

&amp;nbsp;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add the web server role

&amp;nbsp;5.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add ASP.Net4.5 (and 3.5 if you want it)

&amp;nbsp;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the .Net 4.5 feature is already installed but you need to open it up and add ASP.Net 4.5 which is not there at the start.

&amp;nbsp;6.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In Web Server Role &amp;ndash; Role Services; add Basic Authentication

&amp;nbsp;7.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Installing that lot takes five minutes or so

&amp;nbsp;8.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return to server manager (you may be able to do this at the start but I ended up taking a second bite at it) | configure this server

&amp;nbsp;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drill down to Web Server and on to Application Development

&amp;nbsp;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add .Net Extensibility 4.5 (and 3.5 if you want it)

&amp;nbsp;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add ASP.Net 4.5 (and 3.5 if you want it)

&amp;nbsp;9.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Installing them takes another few minutes.

&amp;nbsp;10.&amp;nbsp;&amp;nbsp; Download DNN to the machine &amp;ndash; the enhanced security stuff in IE is a is a pain.&amp;nbsp; Either tolerate it or turn it off like this

&amp;nbsp;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Server Manager | Local Server | Properties | IE Enhanced Security, click the On link and turn it off!

&amp;nbsp;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close &amp;amp; Reopen IE to make it real.

&amp;nbsp;11.&amp;nbsp;&amp;nbsp; Create a folder for your site and expand the DNN download into it

&amp;nbsp;12.&amp;nbsp;&amp;nbsp; In IIS Manager create a Site/VirtualDirectory for your site and point it to the web site folder

&amp;nbsp;13.&amp;nbsp;&amp;nbsp; Set the site to use the .Net 4.5 app pool.

&amp;nbsp;14.&amp;nbsp;&amp;nbsp; Start SQL Server Management Studio

&amp;nbsp;15.&amp;nbsp;&amp;nbsp; Add a Login for IIS APPPOOL\.NET v4.5 &amp;ndash; you *have* to TYPE this.&amp;nbsp; You will NOT find it in the Search box

&amp;nbsp;16.&amp;nbsp;&amp;nbsp; While you are at it, give that account Full Control over the folder your site is going into.

&amp;nbsp;17.&amp;nbsp;&amp;nbsp; Create a Database for the site to use (Standard DNN process - outside scope of this guide)

&amp;nbsp;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; allow your new login access to it

&amp;nbsp;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; give the new login datareader, datawriter, dbowner rights

&amp;nbsp;18.&amp;nbsp;&amp;nbsp; Modify the site web config to point at your database (Standard DNN process &amp;ndash; outside this guide)

&amp;nbsp;19.&amp;nbsp;&amp;nbsp; Allow Port80 traffic to your instance &amp;ndash; this is done by changing the AWS security rules for your instance.&amp;nbsp; You CANT change the instance to use different rules so you have to change the rules it is using.

&amp;nbsp;20.&amp;nbsp;&amp;nbsp; Launch IE and browse to your site to install DNN in the traditional way.

a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I cannot say with certainty that it does not work, but I have NEVER managed to make it work when installing from the browser on the instance.&amp;nbsp; It only worked for me when I browsed to the site from my remote (to the instance) laptop

That&amp;#39;s it.&amp;nbsp; The site came up.
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Tue, 27 Oct 2015 17:38:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:78</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/75/Correcting-a-broken-PortalSettings-table#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=75</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=75&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Correcting a broken PortalSettings table</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/75/Correcting-a-broken-PortalSettings-table</link> 
    <description>Symptom.&amp;nbsp; 
The site crashes with an exception trace like this one.&amp;nbsp; (Warning you only see this on web page if the site allows you to see exception messages.&amp;nbsp; Showing users exception messages is generally a bad security practice.)&amp;nbsp; You may have to look in the event log table to see this.
Server Error in &#39;/&#39; Application.

Input string was not in a correct format.
Description:&amp;nbsp;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.&amp;nbsp;

Exception Details:&amp;nbsp;System.FormatException: Input string was not in a correct format.

Source Error:&amp;nbsp;



    
        
            An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
        
    


Stack Trace:&amp;nbsp;


 
[FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp;amp; number, NumberFormatInfo info, Boolean parseDecimal) +10725735 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +145 System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46 System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +510 DotNetNuke.Collections.CollectionExtensions.ConvertValue(Object value) +100 DotNetNuke.Collections.CollectionExtensions.GetValueOrDefault(IDictionary dictionary, String key, T defaultValue, Func`2 converter) +64 DotNetNuke.Collections.CollectionExtensions.GetValueOrDefault(IDictionary dictionary, String key, T defaultValue) +55 DotNetNuke.Entities.Portals.PortalSettingsController.LoadPortalSettings(PortalSettings portalSettings) +898 DotNetNuke.Entities.Portals.PortalSettings.BuildPortalSettings(Int32 tabId, PortalInfo portal) +28 DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo portalAliasInfo) +94 DotNetNuke.HttpModules.UrlRewrite.BasicUrlRewriter.RewriteUrl(Object sender, EventArgs e) +2131 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +69 
 &amp;nbsp;
&amp;nbsp;
Diagnosis.
This huge and scary message may cause you to panic.&amp;nbsp; Don&#39;t.&amp;nbsp; There are a few useful signals in all that noise.
These things...

DotNetNuke.Entities.Portals.PortalSettingsController.LoadPortalSettings(PortalSettings portalSettings) +898
DotNetNuke.Entities.Portals.PortalSettings.BuildPortalSettings(Int32 tabId, PortalInfo portal) +28
DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo portalAliasInfo)

...appearing in the stack trace make it a reasonable guess that your PortalSettings table contains bad data. 

The presence of System.Number.ParseInt32 in the stack trace suggests that the code found a PortalSetting that should be an integer but isn&#39;t.&amp;nbsp; There are other reasonably named functions that you may see there with ParseXXXXX in the name.&amp;nbsp; The XXXXX gives you a clue about what the expected data is.
Fixing it.
First off take a backup.&amp;nbsp; You are about to do risky stuff in the database and you need a way to recover if things go wrong and you make the situation worse.
Try Sebastian Leupold&#39;s excellent Script.&amp;nbsp; It&#39;s intended to correct errors in the PortalSettings table.&amp;nbsp; https://dnnscript.codeplex.com/releases/view/132975.
If the script does not correct your issue then you need to take a very careful look at your PortalSettings table and use your intuition. You&#39;ll have to guess a bit. You are looking for a setting (or settings) that sounds like it should be an integer (if ParseInt32 appeared in the stack trace) but is either empty or not an integer. In this context something like 1.0 does *not* qualify as an integer. Once you find some suspect data you need to change it to a &#39;reasonable&#39; value.
Once all the PortalSettings have reasonable values the site should come up again.
Leave a comment to let us know how you got on! 
&amp;nbsp;
&amp;nbsp;</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Sun, 02 Aug 2015 08:43:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:75</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/74/Speeding-your-DNN-site-with-Client-Side-caching--Part-1#Comments</comments> 
    <slash:comments>1</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=74</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=74&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Speeding your DNN site with Client Side caching - Part 1</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/74/Speeding-your-DNN-site-with-Client-Side-caching--Part-1</link> 
    <description>Overview

The support files used in a web site, especially javascript and css and images, change quite rarely.&amp;nbsp; Long duration cache headers give a major performance benefit.&amp;nbsp; DNN&amp;#39;s standard tooling automatically provides cache busting parameters.&amp;nbsp; Cache busters allow site developers freedom to change scripts, css and images.&amp;nbsp; Those changes can be immediately propagated to the site users.&amp;nbsp; Download a powershall script to automate setting up cache headers.

Details


There are only two things you need to know about caching.&amp;nbsp; &amp;quot;Don&amp;rsquo;t cache HTML. Cache everything else forever.&amp;quot;&amp;nbsp; Quoted from this article.&amp;nbsp; You should read it now.&amp;nbsp; Go on.&amp;nbsp; I&amp;#39;ll wait!


The quoted article teaches that controlling cached items needs a sure fire way of using a different url when an item changes.&amp;nbsp; DNN gives a lot of help in doing that.&amp;nbsp; Install Fiddler (other great tools exist) to see the url&amp;#39;s DNN generates for the different parts of a page. Fiddler monitors all the http traffic from your machine.&amp;nbsp; A request for this site&amp;#39;s home page might look like this...



The basic page is roughly 21K bytes.&amp;nbsp; Then there is near on a megabyte of javascript and CSS required to support the page.&amp;nbsp; The megabyte of javascript and CSS never (OK rarely) changes.&amp;nbsp; The web site and the browser already recognize that.&amp;nbsp; The browser will drop all of the javascript and the CSS into its local cache, just in case.&amp;nbsp; On a subsequent page request the browser recognizes that there is a copy in the local cache and makes a conditional request for the files.&amp;nbsp; Essentially it says &amp;quot;I already have a version with &amp;#39;this date&amp;#39;.&amp;nbsp; Is that the same version as you would send me?&amp;quot;&amp;nbsp; If it is the version that the server would send, the server returns a 304 response and does not send the full file content.&amp;nbsp; It still requires time to round trip the request to the server but saves the time, and bandwidth, of the full data.&amp;nbsp; In Fiddler it looks like this.



When a response comes back with a caching header, it promises the browser that the data at that url will remain valid for the period specified in the header.&amp;nbsp; For example, in the first image, /Portals/_default/default.css?cdv=73 mentions max-age=31104000 specifying a period of 360 days (in seconds).&amp;nbsp; Once the browser receives that promise, when *any* page on the site requests the cached url the browser does not contact the server at all.&amp;nbsp; The file is used directly from the cache.&amp;nbsp; This is a valuable saving, default.css is used on every page of a DNN site.

Note the urls that end in cdv=73. These are generated by DNN.&amp;nbsp; Some of them come from the basic process of creating a DNN page.&amp;nbsp; Some come from skin objects such as DnnCssInclude and DnnJsInclude. The parameter on the url is never used by the Web server.&amp;nbsp;&amp;nbsp; It is purely there to bypass any locally cached browser content with a different parameter value.&amp;nbsp; Such a parameter is often known as a &amp;#39;Cache Buster&amp;#39;.&amp;nbsp; The cdv parameters are supplied by DNN.&amp;nbsp; They are controlled from Host Settings on the Advanced Settings Tab



Note that the 73 reported there is the same as the cdv=73 parameter.&amp;nbsp; DNN defines a few circumstances that automatically increment the number.&amp;nbsp; If the automated features don&amp;#39;t meet our needs there is a button to increment it manually.&amp;nbsp; After that increment no client browser will have a copy of the new url and browsers will have to request a full fresh copy.&amp;nbsp; This technique allows site management to get the benefits of caching; ensure that clients see up to date information; and have a largely fully automated solution.

From this we can infer that it should be safe to cache any resource that carries a cdv=* parameter.&amp;nbsp; We can also infer that it&amp;#39;s highly risky to cache a resource that does not carry a cache busting parameter.

How to supply cache header information for a file

The easiest way is with a small web.config file in the folder.&amp;nbsp; The location may specify a file &amp;ndash; the cache headers are applied to that file only.&amp;nbsp; The location may specify &amp;lsquo;.&amp;rsquo; &amp;ndash; the cache headers are applied to any file in that folder.&amp;nbsp; Such a web.config file looks like this...



PowerShell makes it easy

I wrote a PowerShell script to make it easy to generate and add the relevant web.config files.&amp;nbsp; You will need direct access to a command shell on the web server to use it.&amp;nbsp; Download it from GitHub&amp;nbsp; (https://github.com/RichardHowells/Dnn.Caching) to a folder on the server.&amp;nbsp; Open a command prompt and navigate to the folder containing the script.&amp;nbsp; Type the command

powershell &amp;ndash;f SetupCachingForDNNSite &amp;ndash;webSiteRootFolder &amp;quot;Full path to the root folder of your web site&amp;quot;

At the time of writing this will add web.config files to cache:


 default.css
 all files in Resources\Libraries
 all files in js
 all files in Resources\Shared\Scripts
 all files in Resources\Shared\Components


It will then iterate over every Portal folder in the Portals folder (it skips the *-System folders)


 it will add a web config file to cache portal.css
 it will create a CachedFiles folder if there is not one there already; and add a web.config to cache every file in that folder.


The intention is that you will manually move your logo image and favicon icon into that folder, changing the site settings to pick them up from that folder.&amp;nbsp; They will then be automatically cached too.

Results

After clearing the browser cache every byte of data needs to be retrieved from the server.&amp;nbsp; This is the worst case and is often referred to as &amp;#39;cold cache&amp;#39;.&amp;nbsp; When some, or all, of the data is already in the cache this state is referred to as &amp;#39;warm cache&amp;#39;.&amp;nbsp; The process of loading data into the cache is referred to as &amp;#39;warming the cache&amp;#39;.

To retrieve this site&amp;#39;s home page:


 
  
   Cache State 
   Requests 
   Approx total bytes 
   Elapsed time 
  
  
   &amp;nbsp;Cold
   43
   1MB
   4 seconds
  
  
   &amp;nbsp;Warm
   3
   27KB
   Under 1 second
  
 


Clearly the warm cache results are massively better although the cold cache is the worst possible case and real-life performance would be better.

Summary - TL;DR;

The support files used in a web site, especially javascript and css and images, change quite rarely.&amp;nbsp; Long duration cache headers give a major performance benefit.&amp;nbsp; DNN&amp;#39;s standard tooling automatically provides cache busting parameters.&amp;nbsp; Cache busters allow site developers freedom to change scripts, css and images.&amp;nbsp; Those changes can be immediately propagated to the site users. &amp;nbsp; Download a powershall script to automate setting up cache headers.
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Wed, 29 Jul 2015 23:00:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:74</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/72/DotNetNuke-Installs-and-Upgrades-need-to-be-Unblocked-before-Installing#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=72</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=72&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>DotNetNuke Installs and Upgrades need to be Unblocked before Installing</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/72/DotNetNuke-Installs-and-Upgrades-need-to-be-Unblocked-before-Installing</link> 
    <description>Installs and upgrades to DotNetNuke (DNN), and to DNN modules, are packaged as .zip files.&amp;nbsp; 
When a zip file is downloaded to a Windows machine it is often &#39;blocked&#39; as a security measure.&amp;nbsp; Before you install; right click on the zip file, choose Properties, and look in the General tab.&amp;nbsp; At the bottom you may see the text &quot;This file came from another computer and might be blocked to help protect this computer.&quot;&amp;nbsp; If you do see this text click the Unblock button next to it.
Using a file that is blocked may result in some of the contained files not being unpacked when the zip file is expanded.</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Wed, 29 Jul 2015 19:04:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:72</guid> 
    
</item>

    </channel>
</rss>